package server

import "github.com/gin-gonic/gin"

func Ip白名单() gin.HandlerFunc {
	return func(c *gin.Context) {

		rrr := false
		for _, v := range 请求白名单 {
			if v == c.ClientIP() || v == "*" {
				rrr = true
			}
		}
		if !rrr { //如果未命中白名单，直接拒绝请求
			c.Abort()
			return
		}
		c.Next()
	}
}
